package com.lj.infoisland.controller;

import com.lj.infoisland.common.convention.result.Result;
import com.lj.infoisland.common.convention.result.Results;
import com.lj.infoisland.domain.cache.HotSearchCache;
import com.lj.infoisland.domain.dto.HotSearchDetailDTO;
import com.lj.infoisland.service.HotSearchRecordService;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/*
 * @description 热点搜索控制层
 * @author 龙洁
 * @create 2024-10-27 下午9:39
 */
@RestController
@RequestMapping("/api/hotSearch")
public class HotSearchController {

    @Resource
    private HotSearchRecordService hotSearchRecordService;

    @GetMapping("/queryByType")
    public Result<HotSearchDetailDTO> queryByType(@RequestParam String type) {
        return Results.success(HotSearchCache.CACHE_MAP.get(type.toUpperCase()));
    }
}
